//assumiamo che l'array è ordinato in modo non decrescente
int [] a = {12, 18, 24, 51, 60, 70, 97, 100 };

int n = Input.getInt("Inserisci il numero da cercare");

boolean trovato = false;

/*
for (int valore:a){
	if (n==valore) {
		trovato=true;	
	}
}
*/

for (int i=0; i<a.length && !trovato && a[i]<=n ; i++) {
	if (n==a[i]) {
		trovato=true;	
	}
}


if (trovato) {
	System.out.println ("Il valore " + n + " è presente nell'array");
} else {
	System.out.println ("Il valore " + n + " non è presente nell'array");
}
